package com.baidu.Chapter02;

import java.util.Scanner;

public class ex2_10 {
    public static void main(String[] args) {
        System.out.print("Enter the amount of water in kilograms：");
        Scanner sc = new Scanner(System.in);
        double k=sc.nextDouble();
        System.out.print("Enter the initial temperature：");
        double intem=sc.nextDouble();
        System.out.print("Enter the final temperature：");
        double fintem=sc.nextDouble();
        double energy=k*(fintem-intem)*4184;
        System.out.printf("The energy needed is %.1f\n",energy);
    }
}
